package com.java.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.java.pojo.Items;
import com.java.pojo.vo.ItemCommentVO;
import com.java.pojo.vo.SearchItemsVO;
import com.java.pojo.vo.ShopcartVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 商品表 商品信息相关表：分类表，商品图片表，商品规格表，商品参数表
 * 
 * @author jl
 * @since 2020-10-13 11:31:41
 */
@Mapper
public interface ItemsDao extends BaseMapper<Items> {

    List<ItemCommentVO> queryItemComments(IPage<ItemCommentVO> page, @Param("commentLevel") Integer commentLevel, @Param("itemId") String itemId);

    List<SearchItemsVO> searchItemsVo(IPage<SearchItemsVO> page,@Param("params") Map<String,Object> params);

    List<SearchItemsVO> searchItemsVoByThirdCatId(IPage<SearchItemsVO> page,@Param("params") Map<String,Object> params);

    List<ShopcartVO> queryItemsBySpecIds(@Param("list") List<String> list);

    int decreaseItemSpecStock(@Param("specId") String specId, @Param("buyCounts") Integer buyCounts);
}
